/*
 ============================================================================
 Name        : PCB.h
 Author      : James McQueen, Corwyn Simpson, Craig Markham
 Version     :
 Date        : 05/14/2012
 Description : TCSS-422 Operating Systems Scheduler
 ============================================================================
 */

#ifndef __PCB__
#define __PCB__

#define READY 'W'
#define RUN 'R'
#define BLOCKED 'B'
#define PAUSED 'P'
#define TERM 'X'

#include "Process.h"

/*-------------------- Process Control Block --------------------*/
typedef struct
{
    int PID;
    int PC;
    char my_state;
    Process* my_process_ptr;	//Pointer to the process.
} PCB;

/********************* PCB Functions *********************/
PCB* pcb_init();
void pcb_destroy(PCB* pcb);
int pcb_getPID(PCB* pcb);
int pcb_getPC(PCB* pcb);
char pcb_getState(PCB* pcb);
Process* pcb_getProcess(PCB* pcb);

void pcb_incrementPC(PCB* pcb);
void pcb_setState(PCB* pcb, char state);

void pcb_setProcess(PCB* pcb, Process* process);

#endif /* PCB_H_ */
